<template>
    <div id="p_timeauto">
        <div style="width: 100%;overflow:scroll;-webkit-overflow-scrolling:touch;background-color:#fff;position:fixed;left:0;top:0;z-index:1;">
        <tab style="width:460px;" :line-width="1">
            <tab-item @on-item-click="$router.push('/m_timeauto/taskmd')" :selected="$route.path=='/m_timeauto/taskmd'">日报</tab-item>
            <tab-item @on-item-click="$router.push('/m_timeauto/habit')" :selected="$route.path=='/m_timeauto/habit'">习惯养成</tab-item>
            <tab-item @on-item-click="$router.push('/m_timeauto/move')" :selected="$route.path=='/m_timeauto/move'">动作记录</tab-item>
            <tab-item @on-item-click="$router.push('/m_timeauto/stand')" :selected="$route.path=='/m_timeauto/stand'">专注时长</tab-item>
            <tab-item @on-item-click="$router.push('/m_timeauto/all')" :selected="$route.path=='/m_timeauto/all'">历史动作</tab-item>
            <!-- <tab-item>移动地图</tab-item> -->
        </tab>
        </div>

        <div style="height:44px;"></div>  <!-- 配合上面div的置顶,div用来站位. -->
        <router-view ref="indexRouter" class="view" keep-alive></router-view>
    </div>
</template>
<script>

import {
    Tab,TabItem
} from 'vux'

export default {
    components: {
        Tab,TabItem,
    },
    computed: {
    },
    watch: {
        
    },
    created() {        
        
    },
    filters: {  
        
    }  ,
    mounted: function() {        
        this.$vux && this.$vux.bus && this.$vux.bus.$on('dologin', this.resetIndex);
    },
    methods: {
        resetIndex(val){
            this.timeindex = 1;
            console.log("resetIndex",val);
        },
    },
    data() {
        return {
            timeindex: 1
        }
    }
}

</script>
<style scoped>

</style>